<?php
Yii::app()->clientScript->registerCoreScript('jquery.ui');

$properties = array(
	'id'=>'channel-form',
	'enableAjaxValidation'=>false,
	'focus'=>array($model, 'sequence'),
);
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', $properties);
?>

<p class="help-block">
	Fields with <span class="required">*</span> are required.
</p>

<?php
echo $form->errorSummary($model);

$htmlOptions = array('class'=>'span5');
echo $form->textFieldRow($model, 'sequence', $htmlOptions);

$htmlOptions = array('class'=>'span5', 'maxlength'=>255);
echo $form->textFieldRow($model, 'name', $htmlOptions);

$hints = array(
	'PHP code that will be executed when displaying measuremet value.',
	'Use $value to refer to the raw measurement value. <br />',
	'Example:<br />',
	'return $value * 1023 + 100;<br />',
	'return $value ? "Terbuka" : "Tertutup";',
);
$htmlOptions = array(
	'class'=>'span5',
	'maxlength'=>255,
	'hint'=>implode(' ', $hints),
);
echo $form->textFieldRow($model, 'rule', $htmlOptions);
?>

<div class="form-actions">
	<?php
	$properties = array(
		'buttonType'=>'submit',
		'type'=>'primary',
		'label'=>$model->isNewRecord ? 'Create' : 'Save',
	);
	$this->widget('bootstrap.widgets.TbButton', $properties);
	?>
</div>

<?php $this->endWidget(); ?>
